<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>Windows Interface Reference: Color structure</title>
</head>

<body>

<h1>Color</h1>

<p>The Color structure contains functions to manipulate colours and palettes.</p>

<pre>structure Color:
  sig
    type HPALETTE and HDC

    datatype
      PaletteEntryFlag = PC_EXPLICIT | PC_NOCOLLAPSE | PC_NULL | PC_RESERVED
    type PALETTEENTRY = {red: int, green: int, blue: int, flags: PaletteEntryFlag}

    type COLORREF
    val toRGB :
       COLORREF -&gt; {red: Int.int, blue: Int.int, green: Int.int}
    val RGB : {red: int, blue: int, green: int} -&gt; COLORREF
    val PALETTERGB : {red: int, blue: int, green: int} -&gt; COLORREF

    type SystemPaletteUse
    val SYSPAL_ERROR : SystemPaletteUse
    val SYSPAL_NOSTATIC : SystemPaletteUse
    val SYSPAL_STATIC : SystemPaletteUse

    val AnimatePalette : HPALETTE * int * PALETTEENTRY list -&gt; bool
    val CreateHalftonePalette : HDC -&gt; HPALETTE
    val CreatePalette : PALETTEENTRY list -&gt; HPALETTE
    val GetNearestColor : HDC * COLORREF -&gt; COLORREF
    val GetNearestPaletteIndex : HPALETTE * COLORREF -&gt; int
    val GetPaletteEntries : HPALETTE * int * int -&gt; PALETTEENTRY list
    val GetSystemPaletteEntries : HPALETTE * int * int -&gt; PALETTEENTRY list
    val GetSystemPaletteUse : HDC -&gt; SystemPaletteUse
    val RealizePalette : HDC -&gt; int
    val ResizePalette : HPALETTE * int -&gt; unit
    val SelectPalette : HDC * HPALETTE * bool -&gt; HPALETTE
    val SetPaletteEntries : HPALETTE * int * PALETTEENTRY list -&gt; unit
    val SetSystemPaletteUse : HDC * SystemPaletteUse -&gt; SystemPaletteUse
    val UnrealizeObject : HPALETTE -&gt; unit
    val UpdateColors : HDC -&gt; unit
  end</pre>
</body>
</html>
